<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>添加编辑配置</title>

    <!-- Bootstrap -->
    <link href="{:config('__public__')}/static/bootstrap-3.3.4/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
	<div class="main-title">
		<h2>添加编辑配置</h2>
	</div>
    <div class="container">
    <form action="{:url('edit_config')}" enctype="application/x-www-form-urlencoded" method="POST"
            class="form-horizontal ajaxForm">


        <div class="form-group">
            <label class="col-sm-12">配置标识<span class="check-tips">（只能使用英文且不能重复）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="name" value="{$info.name|default=''}" required="">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">配置标题<span class="check-tips">（配置标题）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="title" value="{$info.title|default=''}" required="">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">排序<span class="check-tips"></span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="sort" value="{$info.sort|default=0}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">配置类型<span class="check-tips">（系统会根据不同类型解析配置值）</span></label>
            <div class="col-lg-3">
                <select name="type" class="form-control">
                    {volist name="Think.config.CONFIG_GROUP_TYPE" id="group"}
                        <option value="{$group.id}">{$group.type}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">配置分组<span class="check-tips">（配置分组 用于批量设置 不分组则不会显示在系统设置中）</span></label>
            <div class="col-lg-3">
                <select name="group" class="form-control">
                    <option value="0">不分组</option>
                    {volist name="Think.config.CONFIG_GROUP_LIST" id="type"}
                        <option value="{$type.id}">{$type.name}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">配置值<span class="check-tips">（配置值）</span></label>
            <div class="col-lg-6">
                <textarea name="value" class="form-control" rows="3">{$info.value|default=''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">配置项<span class="check-tips">（如果是枚举型 需要配置该项）</span></label>
            <div class="col-lg-6">
                <textarea name="extra" class="form-control" rows="3">{$info.extra|default=''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">说明<span class="check-tips">（配置详细说明）</span></label>
            <div class="col-lg-6">
                <textarea name="remark" class="form-control" rows="3">{$info.remark|default=''}</textarea>
            </div>
        </div>

        <div class="form-group">
            <input type="hidden" name="id" value="{$info.id|default=''}">
            <button type="submit" class="btn btn-success" target-form="form-horizontal">确 定</button>
            <button class="btn btn-warning" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
    </div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{:config('__public__')}/static/bootstrap-3.3.4/dist/js/bootstrap.min.js"></script>
    <script src="{:config('__public__')}/static/jquery-validation-1.16.0/dist/jquery.validate.min.js"></script>
    <script src="{:config('__public__')}/static/form-3.51/jquery.form.js"></script>
    
    <link rel="stylesheet" href="{:config('__public__')}/static/artDialog-6.0.4/css/ui-dialog.css">
    <script src="{:config('__public__')}/static/artDialog-6.0.4/dist/dialog-min.js"></script>
   
    <script type="text/javascript" src="/Admin/js/ajaxSubmit.js"></script>

    <script type="text/javascript" src="/Admin/js/ThinkSetValue.js"></script>
        <script type="text/javascript">
            Think.setValue("type", {$info.type|default = 0});
            Think.setValue("group", {$info.group|default = 0});
        </script>
</body>
</html>
